﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EyFramework.Common;
using EyFramework.Sys.Core;
using ShuJuGj.Dao;
using ShuJuGj.Entity;
using SqlSugar;

namespace ShuJuGj.Core.Service
{
    /// <summary>
    ///  yb_wjxz_1306_temp表的服务实现类 
    /// </summary>
    public class YbWjxz1306TempService : BaseHisService, IYbWjxz1306TempService
    {
		protected readonly IYbWjxz1306TempDao _YbWjxz1306TempDao;

		public YbWjxz1306TempService(IYbWjxz1306TempDao ybWjxz1306TempDao)
		{
			_YbWjxz1306TempDao = ybWjxz1306TempDao;
		}

        public bool Import(List<YbWjxz1306Temp> ybWjxzs)
        {
            _YbWjxz1306TempDao.BeginTrans();
            try
            {
                ybWjxzs.ForEach(p =>
                {
                    _YbWjxz1306TempDao.Insert(p);
                });
                _YbWjxz1306TempDao.CommitTrans();
            }
            catch (Exception ex)
            {
                _YbWjxz1306TempDao.RollBackTrans();
                throw new BizException(ex.ToString());
            }
            return true;
        }
    }
}
